Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A bug fix in the extra-index-url argument for az extension add and update commands. #5491

Merged
merged 9 commits into from Feb 6, 2018
Merged

Conversation

ghost
Copy link

@ghost ghost commented Feb 6, 2018

The PR fixes the following bug.
While adding the support for --extra-index-url in az extension add and update commands, I assumed --extra-index-url argument in pip install to be defined using nargs='+'. But that is not the case, it uses action='append'.

So, I changed the pip command accordingly and also modified the tests.

The pip code for extra-index-url is at this link.
https://github.com/pypa/pip/blob/master/src/pip/_internal/cmdoptions.py#L260

A simple code that shows the bug that the PR resolves.

import argparse
parser = argparse.ArgumentParser(prog='PROG', usage='%(prog)s [options]')
parser.add_argument('--foo', action='append', help='foo help')
parser.parse_args(['--foo', 'YYY', '--foo', 'abc'])
parser.parse_args(['--foo', 'YYY', 'abc'])

This checklist is used to make sure that common guidelines for a pull request are followed.

General Guidelines

  • The PR has modified HISTORY.rst describing any customer-facing, functional changes. Note that this does not include changes only to help content. (see Modifying change log).

Command Guidelines

  • Each command and parameter has a meaningful description.
  • Each new command has a test.

(see Authoring Command Modules)

adyada and others added 7 commits January 31, 2018 19:08
* Update History.rst file.

* Added first version of az extension add --extra-index-url test.

* Added first version of az extension add --extra-index-url test.

* Pep8 fixing

* Pep8 fixing.

* Pep 8 fix.

* Modified the extra-index-url test. Modified the code to give preference to --extra-index-urls

* Added some bebug statement.

* Hopefully all build problems fixed.

* Hopefully all build problems fixed.

* Removed prints.
* Resolved PR comments.

* Removed unnecessary extra index url precedence logic.
@ghost ghost requested a review from derekbekoe February 6, 2018 01:11
@promptws
Copy link

promptws commented Feb 6, 2018

View a preview at https://prompt.ws/r/Azure/azure-cli/5491
This is an experimental preview for @microsoft users.

Copy link
Member

@derekbekoe derekbekoe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need for the v. no. changes.
LGTM otherwise.

0.0.10
++++++
A bug fix in the --extra-index-url argument in az extension add and update commands.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We haven't released 0.0.9 yet so you can just modify the entry you created prev. for that one.

@@ -14,7 +14,7 @@
logger.warn("Wheel is not available, disabling bdist_wheel hook")
cmdclass = {}

VERSION = "0.0.9"
VERSION = "0.0.10"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then no need to change the version no.

@derekbekoe derekbekoe added this to the Sprint 31 milestone Feb 6, 2018
@derekbekoe derekbekoe added the Extensions `az extension` commands or extension infrastructure label Feb 6, 2018
@derekbekoe derekbekoe merged commit ec20093 into Azure:dev Feb 6, 2018
LukaszStem pushed a commit to LukaszStem/azure-cli that referenced this pull request Feb 21, 2018
…date commands. (Azure#5491)

* Added the extra-index-urls change to az extension add and update commands.

* Bumped the version.

* Added --extra-index-url support. Added tests. (Azure#1)

* Update History.rst file.

* Added first version of az extension add --extra-index-url test.

* Added first version of az extension add --extra-index-url test.

* Pep8 fixing

* Pep8 fixing.

* Pep 8 fix.

* Modified the extra-index-url test. Modified the code to give preference to --extra-index-urls

* Added some bebug statement.

* Hopefully all build problems fixed.

* Hopefully all build problems fixed.

* Removed prints.

* Resolved PR comments. (Azure#2)

* Removed precedence for extra index urls

* Resolved PR comments.

* Removed unnecessary extra index url precedence logic.

* Updated the version number.

* Changed the argument name.
@haroldrandom haroldrandom added the Extensions `az extension` commands or extension infrastructure label Oct 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Extensions `az extension` commands or extension infrastructure
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants